package com.tpyule.tpclass.web.Controller;

import com.fasterxml.jackson.databind.ObjectMapper;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author zzz
 * @date 2020/2/21 0021 下午 4:56
 */
public class BaseController {

    public void setAjaxResponseResult(HttpServletResponse response, Object resultObject) throws IOException {
        response.setContentType("text/html;charset=UTF-8");
        ObjectMapper objectMapper=new ObjectMapper();
        String result=objectMapper.writeValueAsString(resultObject);
        response.getWriter().write(result);
    }
}
